Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes role self more dynamic #1199

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Makes role self more dynamic #1199

wants to merge 1 commit into from

Conversation

ajax146
Copy link
Contributor

@ajax146 ajax146 commented Dec 19, 2024

This makes role self build a dynamic list of assignable roles, based on what roles the person running the command has.

This also moves all of the /role command to use IDs instead of names.

@ajax146 ajax146 changed the title Makes role self more dynamic.= Makes role self more dynamic Dec 19, 2024
@TheKrol
Copy link
Contributor

TheKrol commented Feb 19, 2025

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/discord/client.py", line 449, in _run_event
await coro(*args, **kwargs)
File "/var/TechSupportBot/techsupport_bot/core/cogs.py", line 125, in on_message
result = await self.match(config, ctx, message.content)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/TechSupportBot/techsupport_bot/commands/protect.py", line 187, in match
if not str(ctx.channel.id) in config.extensions.protect.channels.value:
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/munch/init.py", line 121, in getattr
raise AttributeError(k)
AttributeError: protect

I think this is due to me not have protect in my config, but the bot won't let you do anything if you don't have the config.

@TheKrol
Copy link
Contributor

TheKrol commented Feb 19, 2025

2025-02-19 08:47:55.936 INFO: Command detected: /role self
2025-02-19 08:47:56.554 ERROR: Command error: Command 'self' raised an exception: AttributeError: 'RoleGiver' object has no attribute 'locked'
2025-02-19 08:47:56.555 ERROR: Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/discord/app_commands/commands.py", line 857, in _do_call
return await self._callback(self.binding, interaction, **params) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/TechSupportBot/techsupport_bot/commands/role.py", line 124, in self_role
await self.role_command_base(
File "/var/TechSupportBot/techsupport_bot/commands/role.py", line 201, in role_command_base
if identifier in self.locked:
^^^^^^^^^^^
AttributeError: 'RoleGiver' object has no attribute 'locked'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/discord/app_commands/tree.py", line 1310, in _call
await command._invoke_with_namespace(interaction, namespace)
File "/usr/local/lib/python3.11/site-packages/discord/app_commands/commands.py", line 883, in _invoke_with_namespace
return await self._do_call(interaction, transformed_values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/discord/app_commands/commands.py", line 876, in _do_call
raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'self' raised an exception: AttributeError: 'RoleGiver' object has no attribute 'locked'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants